package com.lhb.aicodemother.ai.model.enums;

import cn.hutool.core.util.ObjUtil;
import lombok.Getter;

// 代码生成模式枚举类
@Getter
public enum CodeGenTypeEnum {
    HTML("原生HTML模式","html"),
    MULTI_FILE("原生多文件模式","multi_file"),
    VUE_PROJECT("Vue工程模式","vue_project");

    private final String text;
    private final String value;

    CodeGenTypeEnum(String text, String value) {
        this.text = text;
        this.value = value;
    }

    // 根据value获取枚举
    public static CodeGenTypeEnum getValue(String value){
        if(ObjUtil.isEmpty(value)){
            return null;
        }
        for(CodeGenTypeEnum codeGenTypeEnum:CodeGenTypeEnum.values()){
            if(ObjUtil.equals(codeGenTypeEnum.value,value)){
                return codeGenTypeEnum;
            }
        }
        return null;
    }


}
